﻿using Zhp.Entity.Sys;
using Zhp.SqlSugar.Trigger;
using Zhp.SqlSugar.Trigger.Core;

namespace Zhp.Trigger.Service
{
    [Trigger("SysUser")]
    public sealed class SysUserTrigger : BaseTriggerService<SysUser, long>
    {
        public override void Deleted(SysUser entity)
        {
            Context.Deleteable<SysUserRole>(x => x.UserId == entity.Id).ExecuteCommand();
            Context.Deleteable<SysUserMenu>(x => x.UserId == entity.Id).ExecuteCommand();
        }
    }
}